home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_aet_getgemblue.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  121 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_GetGemBlue.cog
  4. #
  5. # [RT] [TL]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message        activated
  14. message        callback
  15. message        startup
  16.  
  17. # Change these variables ONLY!
  18. # -------------------------------------------------------------------
  19.  
  20. # Use in_pickup_low or in_pickup_med for the "get" keyframe
  21. keyframe    get=in_pickup_med.key    local
  22. #keyframe    get=in_reach_high.key    local
  23.  
  24. # Item-specific voice line
  25. sound        foundSnd=INXJ193.wav    local
  26.  
  27. # Item bin number
  28. int            bin=96                    local
  29. thing        target                            # Tagert ghost for offset.    
  30.  
  31. # Don't touch!
  32. # -------------------------------------------------------------------
  33.  
  34. cog            talkCog                    local
  35.  
  36. thing        player                    local
  37. thing        item
  38.  
  39. end
  40.  
  41. # ===================================================================
  42.  
  43. code
  44.  
  45. startup:
  46.  
  47. player = GetLocalPlayerThing();
  48.  
  49. return;
  50.  
  51. # -------------------------------------------------------------------
  52. activated:
  53.  
  54.     # Check to see if player is holding something. 
  55.     if (GetCurItem(player) != 0)
  56.         {
  57.         return;
  58.         }
  59.  
  60.     player = GetSourceRef();
  61.  
  62.     # Disable player controls and stuff
  63.     if (MakeMeStop() == -1)
  64.         return;
  65.     DeselectWeaponWait(player);
  66.  
  67.     # Make sure this pickup is valid
  68.     if (GetInv(player, bin) < GetInvMax(player, bin))
  69.     {
  70.         StartCutscene(0);
  71.  
  72.         # Capture player so we get callback message
  73.         CaptureThing(player);
  74.         # Start the animation
  75.         PlayKey(player, get, 5, 0x12, 0); 
  76.     }
  77.     else
  78.     {
  79.         ClearActorFlags(player, 0x200000);
  80.         return;
  81.     }
  82.  
  83.     # Call the Pickup Lines cog
  84.     talkCog = GetCogByIndex(0);
  85.     SendMessage(talkCog, 27);
  86.  
  87.     # Set up the camera
  88.     SetExtCamOffsetToThing(target);
  89.  
  90.     return;
  91.  
  92. # -------------------------------------------------------------------
  93.  
  94. callback:
  95.  
  96.     ReleaseThing(player);
  97.  
  98.     # Get rid of the item
  99.     DestroyThing(item);
  100.     
  101.     # Add to inventory
  102.     ChangeInv(player, bin, 1.0);
  103.     SetInvAvailable(player, bin, 1);
  104.     JonesInvItemChanged(bin);
  105.  
  106.     # Wait a bit, then start the voice line
  107.     Sleep(1.0);
  108.     PlayVoice(player, foundSnd, 1.0, 0);
  109.  
  110.     # Reset the camera
  111.     RestoreExtCam();
  112.  
  113.     # Enable player control
  114.     ClearActorFlags(player, 0x200000);
  115.     EndCutscene();
  116.  
  117.     return;
  118.  
  119. end
  120.  
  121.